home *** CD-ROM | disk | FTP | other *** search
- //------------------------------------------------------------------------------
- // File: $$CLASS_NAME$$Prop.cpp
- //
- // Desc: DirectMusicTool Wizard generated code - Implementation of
- // $$CLASS_NAME$$Prop
- //
- // Copyright (c) Microsoft Corporation. All rights reserved.
- //------------------------------------------------------------------------------
-
- /////////////////////////////////////////////////////////////////////////////
- // TODO List: (Functions that are only partially implemented)
- // - OnInitDialog()
- // - Apply()
- //
- /////////////////////////////////////////////////////////////////////////////
-
-
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
-
- #define STRICT
- #ifndef _WIN32_WINNT
- #define _WIN32_WINNT 0x0400
- #endif
-
- #define _ATL_APARTMENT_THREADED
- #define _ATL_STATIC_REGISTRY
-
- #include <atlbase.h>
- //You may derive a class from CComModule and use it if you want to override
- //something, but do not change the name of _Module
- extern CComModule _Module;
- #include <atlcom.h>
- #include <atlctl.h>
- #include <statreg.h>
- #include <statreg.cpp>
- #include <atlimpl.cpp>
-
-
- #include "$$CLASS_NAME$$.h"
- #include "$$CLASS_NAME$$Prop.h"
-
- /////////////////////////////////////////////////////////////////////////////
- // $$CLASS_NAME$$Prop
-
- $$CLASS_NAME$$Prop::$$CLASS_NAME$$Prop()
- {
- m_dwTitleID = IDS_TITLE_$$TOOL_DEFINE$$PROP; // TODO: Define this in the resource file
- m_dwHelpFileID = IDS_HELPFILE_$$TOOL_DEFINE$$PROP; // TODO: Define this in the resource file
- m_dwDocStringID = IDS_DOCSTRING_$$TOOL_DEFINE$$PROP; // TODO: Define this in the resource file
- m_p$$INTERFACE_NAME$$ = NULL;
- }
-
- STDMETHODIMP $$CLASS_NAME$$Prop::SetObjects(ULONG cObjects,IUnknown **ppUnk)
- {
- if (cObjects != 1)
- {
- return E_UNEXPECTED;
- }
-
- return ppUnk[0]->QueryInterface(IID_$$INTERFACE_NAME$$,(void **) &m_p$$INTERFACE_NAME$$);
- }
-
-
- STDMETHODIMP $$CLASS_NAME$$Prop::Apply(void)
- {
- if (!m_p$$INTERFACE_NAME$$)
- {
- return E_UNEXPECTED;
- }
-
- $$TOOLID_NAME$$Params params;
- ZeroMemory(¶ms, sizeof($$TOOLID_NAME$$Params));
-
- $$IF(EMPTY_TOOL)
- // TODO: Get parameter values from the controls
- // Example:
- params.dwParam1 = static_cast<DWORD>(m_ctValue1.GetValue());
- // End of Example
- $$ELSE // Sample DMTool
- params.dwNumber = static_cast<DWORD>(m_ctValue1.GetValue());
- params.dwDelay = static_cast<DWORD>(m_ctValue2.GetValue());
- $$ENDIF
-
- HRESULT hr = m_p$$INTERFACE_NAME$$->SetAllParameters(¶ms);
-
- if (FAILED(hr))
- {
- return hr;
- }
-
- m_bDirty = FALSE;
- return S_OK;
- }
-
- LRESULT $$CLASS_NAME$$Prop::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
- {
- if(m_p$$INTERFACE_NAME$$)
- {
- $$TOOLID_NAME$$Params params;
- ZeroMemory(¶ms, sizeof($$TOOLID_NAME$$Params));
- m_p$$INTERFACE_NAME$$->GetAllParameters(¶ms);
-
- $$IF(EMPTY_TOOL)
- // TODO: Initialize controls and their values.
- // Example:
- m_ctValue1.Init(GetDlgItem(IDC_SLIDER1),GetDlgItem(IDC_SLIDER1_DISPLAY),0,100,true);
- m_ctValue1.SetValue(static_cast<float>(params.dwParam1));
- // End of Example
- $$ELSE // Sample DMTool
- m_ctValue1.Init(GetDlgItem(IDC_SLIDER1),GetDlgItem(IDC_SLIDER1_DISPLAY),1,4,true);
- m_ctValue1.SetValue(static_cast<float>(params.dwNumber));
-
- m_ctValue2.Init(GetDlgItem(IDC_SLIDER2),GetDlgItem(IDC_SLIDER2_DISPLAY),0,1000,true);
- m_ctValue2.SetValue(static_cast<float>(params.dwDelay));
- $$ENDIF
-
- }
- return 1;
- }
-
- LRESULT $$CLASS_NAME$$Prop::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
- {
- LRESULT lr = m_ctValue1.MessageHandler(uMsg, wParam,lParam, bHandled);
- $$IF(!EMPTY_TOOL) // Sample DMTool
- if(!bHandled)
- lr = m_ctValue2.MessageHandler(uMsg, wParam,lParam, bHandled);
- $$ENDIF
- if (bHandled)
- SetDirty(true);
- return lr;
- }
-
- LRESULT $$CLASS_NAME$$Prop::OnControlMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
- {
- LRESULT lr = m_ctValue1.MessageHandler(uMsg, wParam,lParam, bHandled);
- $$IF(!EMPTY_TOOL) // Sample DMTool
- if(!bHandled)
- lr = m_ctValue2.MessageHandler(uMsg, wParam,lParam, bHandled);
- $$ENDIF
- if (bHandled)
- SetDirty(true);
- return lr;
- }
-